<?php
declare (strict_types = 1);

namespace app\admin\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class ExpandCustomer extends Model
{
    public function getItemsValueAttr($value,$data){
        return $data['items'] ? json_decode($data['items'],true) : [];
    }

    public function getUserLinkAttr($value,$data){
        return $data['user_id'] ? 'https://www.facebook.com/'.$data['user_id'] : '';
    }

    public function getKeywordsAttr($value,$data){
        if(!$value){
            return '';
        }
        $format = json_decode($value,true);
        return $format ? implode(',',$format) : '';
    }
}
